/***************************************************************************
 *  -- Copyright Bit Armory Labs 2007
 *
 * FILE:     ClassTemplate.cs, 16 code lines, [358 Bytes]
 * DATE:     8/26/2007 5:42 PM
 * MODIFIED: 8/26/2007 6:21 PM
 * PATH:     C:\Programming\Projects\Slinks\Slinks.Resources
 *
 * NAMESPACE: Slinks.Generator
 * CLASS:     ClassTemplateFactory
 *
 * AUTHOR:   Brian Chavez (Cowboy), bchavez@bitarmory.com
 *
 *                        Licence
 *
 * This library, code generator, and source code
 * is licensed under the terms and conditions defined in the GNU Public
 * License. You are free to use it for non-commercial purposes.
 * If you are going to use any part of it in a commercial 
 * application, contact me and we can work something out.
 * You may use the code generated output of Slink and Slink
 * as a development tool in both commercial and 
 * non-commercial applications.
 *
 * THE SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS", WITHOUT WARRANTY
 * OF ANY KIND, EXPRESS OR IMPLIED. IN NO EVENT SHALL THE AUTHOR BE
 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OF THIS
 * SOFTWARE.
 ***************************************************************************/

using System;
using System.Collections.Generic;
using System.Text;
using TaHoGen.Generators;
using TaHoGen;

namespace Slink.Generator
{
    public static class ClassTemplateFactory
    {
        private static Type classTemplateType = null;

        /// <summary>
        /// Create class template factory
        /// </summary>
        static ClassTemplateFactory()
        {
            ClassTemplateFactory.classTemplateType = TemplateFactory.GetTemplateGeneratorType( System.Text.ASCIIEncoding.ASCII.GetString(Properties.Resources.ClassTemplate) );
        }

        /// <summary>
        /// Create class text generator
        /// </summary>
        /// <param name="className">Class name</param>
        /// <param name="pageUrl">Absolute url</param>
        /// <param name="pageTildeUrl">Tidle url</param>
        /// <returns>Text generator</returns>
        public static TextGenerator CreateClassTextGenerator( string className, string pageUrl, string pageTildeUrl )
        {
            PropertyTable pt = new PropertyTable();
            pt["ClassName"] = className;
            pt["TildeUrl"] = pageTildeUrl;
            
            TextGenerator classTextGenrator = TemplateFactory.CreateTextGenerator( ClassTemplateFactory.classTemplateType, pt );
            
            return classTextGenrator;
        }
    }
}
